<template>
  <div class="suys">
    <div class="sys_item" v-for="item in list" :key="item.NAME">
      <div class="title">
        <span>{{item.NAME}}</span>
      </div>
      <!-- 列表 -->
      <div class="sys_list_box">
        <div class="sys_list" v-for="chid in item.CHILDS" :key="chid.name">
          <div class="item_c">
            <div class="sys_top_box">
              <div :class="chid.IS_WEAKLESS === '1' ? 'top_iconR' : 'top_icon'">
                <img :src="urllis + chid.darkIcon" alt="" />
              </div>
              <span class="top_title">{{chid.name}}</span>
              <span class="top_btn" @click="clicklINK(chid)">点击进入</span>
            </div>
          </div>
        </div>

      </div>

    </div>
  </div>
</template>

<script>
export default {
  props:{
    list:{
      type:Array,
      default:[],
      username:[],
      userpwd:[],
     
    }
  },
  created(){
    this.getLoginUrLInfo();
  },
  data(){
    return{
      urllis: this.$API.iconUrl,
      userId: localStorage.getItem("USER_ID"),
      interfaceName: "antu.newportal-zjx.provider"
    }
  },
  methods:{
     clicklINK(child){
      //  if(item.name=="公文处理"){
         this.$parent.getSystemInfo(child.sysId)
      //  }else{
      //     window.open(child.link +(child.link.indexOf('?')>0 ? "&" :"?")  + "uid=" +
      //     this.username +"&pwd=" + this.userpwd) 
      //  }
    },
    // 获取登录名和密码
    getLoginUrLInfo() {
      this.$.ajax({
        url: this.$API.ajaxPath,
        type: "post",
        data: {
          interfaceName: this.interfaceName,
          methodName: "getLoginUrLInfo",
          args: [this.userId]
        },
        dataType: "json",
        success: (response) => {
          // console.log(response,'234234')
          if (response.status == "0") {
            response.result = JSON.parse(response.result);
            this.username = response.result.loginName;
            this.userpwd = response.result.pwd;
          }
        },
        error: (xhr) => {
          console.log(xhr);
        },
      });
    },
  }
};
</script>

<style lang="less" scoped>
 .top_btn{
    cursor: pointer;
  }
   .top_icon{
                  display: inline-block;
                  width: 32px;
                  height: 32px;
                  background: #18a0fb;
                  border-radius: 3px;
                  
                  img{
                    width: 20px;
                    height: 20px;
                    position: relative;
                    left: 6px;
                    top: 7px;
                  }
                }
                .top_iconR{
                  display: inline-block;
                  width: 32px;
                  height: 32px;
                  background: rgba(255,255,255,0.10);
                  border-radius: 3px;
                  
                  img{
                    width: 20px;
                    height: 20px;
                    position: relative;
                    top: 7px;
                    left: 6px;
                  }
                }
 .suys{
   width: 100%;
   height: 67vh;
     overflow-y: scroll;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
  &::-webkit-scrollbar {
    display: block;
  }
  &::-webkit-scrollbar {
    width : 10px!important;  /*高宽分别对应横竖滚动条的尺寸*/
  }
  &::-webkit-scrollbar-thumb {
    border-radius: 10px!important;
    box-shadow   : inset 0 0 5px rgba(0, 0, 0, 0.2)!important;
    background   :  #ffffff!important
  }
  &::-webkit-scrollbar-track {
    box-shadow   : inset 0 0 5px rgba(0, 0, 0, 0.2)!important;
  border-radius: 10px!important;
  background   : rgba(37, 43, 90, 0.88)!important;
  }
 }
 .sys_item:nth-child(1){
   height: 128px;
   margin-top:0;
   .sys_list_box{
     min-height: 92px;
   }
 }
 .sys_item:nth-child(2){
   height: 128px;
    margin-top:0;
   .sys_list_box{
    min-height: 92px;
   }
 }
 .sys_item:nth-child(3){
   height: 128px;
    margin-top:0;
   .sys_list_box{
     min-height: 92px;
   }
 }
 .sys_item:nth-child(4){
   height: 128px;
   .sys_list_box{
     min-height: 92px;
   }
 }
.sys_item {
  width: 363px;
  height: 200px;
  min-height: 200px;
  margin-right: 2vw;
  margin-top: 30px;
  display: inline-block;
  .title{
    color:#fff;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    span{
      display: inline-block;
      padding-bottom: 15px;
      border-bottom: 1px solid #18a0fb;
    }
  }
}
.sys_list_box{
  height: 173px;
   overflow-y: auto;
  &::-webkit-scrollbar {
    display: block;
  }
  &::-webkit-scrollbar {
    width: 1px;
  }
  &::-webkit-scrollbar-thumb {
    background-color: none;
  }
  &::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 5px transparent;
    background: none;
  }
}
.sys_list {
  .item_c {
    border-radius: 0px 0px 5px 5px;
    padding-top: 8px;
    background: rgba(24, 65, 141, 0.95);
  }
  .item_c:first-child {
    padding-top: 8px;
  }
  .sys_top_box {
    color: #fff;
    margin-right: 5px;
    .top_icon {
      display: inline-block;
      width: 32px;
      height: 32px;
      background: #18a0fb;
      border-radius: 3px;

      img {
        width: 14px;
        height: 14px;
        position: relative;
        left: 9px;
        top: 9px;
      }
    }
    .top_title {
      display: inline-block;
      font-size: 16px;
      position: relative;
      top: 8px;
      left: 12px;
      font-family: Alibaba PuHuiTi, Alibaba PuHuiTi-Bold;
    }
    .top_btn {
      width: 80px;
      height: 32px;
      float: right;
      opacity: 1;
      font-size: 14px;
      text-align: center;
      line-height: 33px;
      background: rgba(0, 133, 255, 0.3);
      border-radius: 3px;
      display: inline-block;
        &:hover{
          background-color: rgba(0, 133, 255,0.65);
        }
    }
  }
 
}
</style>